﻿// -----------------------------------------------------------------------------
// Generate By Furion Tools v3.0.6                            
// -----------------------------------------------------------------------------

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using HOPU.OnlineSchool.Core;

namespace HOPU.OnlineSchool.Core
{
    public partial class AclUser : IEntity<MasterDbContextLocator>, IEntityTypeBuilder<AclUser, MasterDbContextLocator>
    {
    
        public string Id { get; set; }
        public string Username { get; set; }
        public string Password { get; set; }
        public string NickName { get; set; }
        public string Salt { get; set; }
        public string Token { get; set; }
        public byte IsDeleted { get; set; }
        public DateTime GmtCreate { get; set; }
        public DateTime GmtModified { get; set; }
    
        public void Configure(EntityTypeBuilder<AclUser> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
                entityBuilder.ToTable("acl_user");

                entityBuilder.HasComment("用户表");

                entityBuilder.HasIndex(e => e.Username, "uk_username")
                    .IsUnique();

                entityBuilder.Property(e => e.Id)
                    .HasMaxLength(19)
                    .HasColumnName("id")
                    .IsFixedLength(true)
                    .HasComment("会员id");

                entityBuilder.Property(e => e.GmtCreate)
                    .HasColumnName("gmt_create")
                    .HasComment("创建时间");

                entityBuilder.Property(e => e.GmtModified)
                    .HasColumnName("gmt_modified")
                    .HasComment("更新时间");

                entityBuilder.Property(e => e.IsDeleted)
                    .HasColumnName("is_deleted")
                    .HasComment("逻辑删除 1（true）已删除， 0（false）未删除");

                entityBuilder.Property(e => e.NickName)
                    .HasMaxLength(50)
                    .HasColumnName("nick_name")
                    .HasComment("昵称");

                entityBuilder.Property(e => e.Password)
                    .IsRequired()
                    .HasMaxLength(32)
                    .HasColumnName("password")
                    .HasDefaultValueSql("''")
                    .HasComment("密码");

                entityBuilder.Property(e => e.Salt)
                    .HasMaxLength(255)
                    .HasColumnName("salt")
                    .HasComment("用户头像");

                entityBuilder.Property(e => e.Token)
                    .HasMaxLength(100)
                    .HasColumnName("token")
                    .HasComment("用户签名");

                entityBuilder.Property(e => e.Username)
                    .IsRequired()
                    .HasMaxLength(20)
                    .HasColumnName("username")
                    .HasDefaultValueSql("''")
                    .HasComment("微信openid");
        }

    }
}
